package com.gipson.amc.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * <p>
 * 用户
 * </p>
 *
 * @author zj
 * @since 2020-04-26
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("SYS_ROLE")
public class Role implements Serializable {

    private static final long serialVersionUID = 1L;


    @TableId(value = "ID", type = IdType.UUID)
    private String id; // GUID主键

    /**
     * 角色编码
     */
    @TableField("ROLE_CODE")
    private String roleCode;

    /**
     * 角色名称
     */
    @TableField("ROLE_NAME")
    private String roleName;


    @TableField(exist = false)
    private List<Authority> authorityList;

    @TableField("REMARK")
    private String remark;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField("CREATE_TIME")
    private Date createTime; // 创建时间

    @TableField("CREATE_USER")
    private String createUser; // 创建人

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField("UPDATE_TIME")
    private Date updateTime; // 修改时间

    @TableField("UPDATE_USER")
    private String updateUser; // 修改人

    @TableField("APPLICATION_ID")
    private String applicationId; // 应用ID
    
    //自定义
    @TableField(exist = false)
    private String applicationName;//应用名称
    /**
     *
     */
    @TableField(exist = false)
    private String[] roleIdNotIn;

    @TableField(exist = false)
    private String createUserName;

    @TableField(exist = false)
    private String updateUserName;

}
